﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _2_7
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            double sum = 0;
            int n = 0;
            int denominator = 0;
            int increment = 1;
            string formulaText = "1";

            
            for (int i = 1; i < 10; i++)
            {
                denominator += increment;
                formulaText += " + 1/" + denominator;
                increment++;
            }
            formulaText += " + …";
            textBox2.Text = formulaText;

           
            denominator = 0;
            increment = 1;
            sum = 1; 
            n = 1;

            while (true)
            {
                denominator += increment;
                increment++;
                double term = 1.0 / denominator;
                if (term < 1e-4)
                {
                    break;
                }
                sum += term;
                n++;
            }

            textBox1.Text = sum.ToString();
            textBox3.Text = n.ToString();
        }
    }
}